<?php if(count($product)) : ?>
<div class="bg-pattern pt-100 pb-50">
    <div class="container pt-40">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <div class="main-product">
                <img src="/files/images/<?php echo h($product['Product']['image'])?>" width="609" height="353" />
                <img src="/images/fr_dotted_product.png" alt="" class="fr-product" />
                <!-- 
                <div class="count-product">
                <p>Sản phẩm</p>
                <p>01</p>
                </div>
                -->
            </div>
        </div>
        <img src="/images/logo_aeon.png" alt="" class="logo-aeon" />
    </div><!-- /container -->
</div><!-- /bg-pattern -->
  
<div class="bg-blue">
    <div class="container">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <h2 class="name-product"><?php echo h($product['Product']['name'])?></h2>
            <p class="des-product">
				<?php echo h($product['Product']['description'])?>
			</p>
			<?php echo $this->Session->flash('result'); ?>
            <div id="user-list"><?php echo $this->element('user_list');?></div>
            <div class="clear pt-30 action-block">
                <a href="javascript:void(0)" class="button-refresh" rel="<?php echo h($product['Product']['product_id'])?>"><img src="/images/img_refresh.png" alt="" class="over4" /></a>
                <form method="post" action="/products/result">
					<input type="submit" class="button-01" value="Kết quả"/>
					<input type="hidden" name="product_id" value="<?php echo h($product['Product']['product_id'])?>">
				</form>
			</div>
			<img src="/images/bg_tree.png" alt="" class="bg-tree" />
        </div>
    </div><!-- /container -->
</div>
<?php else :?>
<div class="bg-pattern pt-100 pb-50">
    <div class="container pt-40">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <div class="main-product">
                <img src="/files/images/<?php echo h(@$product['Product']['image'])?>" width="609" height="353" />
                <img src="/images/fr_dotted_product.png" alt="" class="fr-product" />
            </div>
        </div>
        <img src="/images/logo_aeon.png" alt="" class="logo-aeon" />
    </div><!-- /container -->
</div><!-- /bg-pattern -->

<div class="bg-blue">
    <div class="container" align="center">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <p class="welcome-text">Không còn sản phẩm</p>
        </div>
    </div><!-- /container -->
</div>
<?php endif;?>
<script>
$(document).ready(function(){
	$('.button-refresh').click(function(){
        var id = $(this).attr('rel');
		$.ajax({
			url: '/products/getUserLogin',
			type: 'post',
            data: {product_id: id},
			success: function(response) {
				$('#user-list').html(response);
			}
		});
	});
});
</script>